layui.use('laydate', function(){
    var laydate = layui.laydate;
    //日期时间选择器
    laydate.render({
        elem: '#starttime'
        ,type: 'datetime'
    });
    laydate.render({
        elem: '#endtime'
        ,type: 'datetime'
    });
    laydate.render({
        elem: '#startTimeU'
        ,type: 'datetime'
    });
    laydate.render({
        elem: '#endTimeU'
        ,type: 'datetime'
    });
    laydate.render({
        elem: '#timeId'
        ,type: 'datetime'
    });
});
function translaDate(data){   //自定义时间转化
    var dates=new Date(data);
    var year=dates.getFullYear();
    var month=dates.getMonth()+1;
    month=addZelo(month);
    var day=dates.getDate();
    day=addZelo(day);
    var hours=dates.getHours();
    hours=addZelo(hours);
    var minutes=dates.getMinutes();
    minutes=addZelo(minutes);
    var seconds=dates.getSeconds();
    seconds=addZelo(seconds);
    var dateStr=year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;
    return dateStr;
}
function addZelo(num){
    if(num>9){
        return num;
    }
    return '0'+num;
}